Part Number Hot Search : 
LS85A NJU3716A 2SC4186 00RL7 XE0471 CA3306M ML1469 D100N
Product Description
Full Text Search
 

To Download EM78M612CBM Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 1 em78m612 universal serial bus microcontroller v1.1 specification revision history version content update 1.0 ? initial version 2003/03/05 1.1 ? correction for some text in general description p2 ,rom size 12k 2k ? correction for pin configuration of em78m612xbp p5 ? adc converter channel selector table fixed p16 ,ch1 reserved ? added pda register description p20 ,ioc9 ? correction for eeprom function description p24 ? changes made to pda function description p29-32 ? revised adc converter ready bit for adc operation p17 , p34 ,ras[7] 2004/04/28
em78m612 universal serial bus microcontroller series this spe c ifica t ion may cha nge with out furthe r notice . 2004/4/2 ps/2 application support 8 v1 .1 2 specifica t ion 1 general description the em78m612 is a series of universal seri al bus 8-bit risc multi-time programming (mtp) microcontrollers. it is specifically designed for usb low speed device application and to support legacy device such as ps/2 m ouse. the em78m612 also support one device address and two endpoints. with no firmware involv ed, these series of microcontrollers can automatically identify and decode standar d usb command to endpoint zero. the em78m612 is implemented on a risc archit ecture. it has five-level stack and eight interrupt sources. the amount of general inpu t/output pins is up to 15. each device has 112 bytes sram and is embedded with 4 bytes of e 2 prom. the rom size of the em78m612 is 2k. these series of chips have special features that accommodate your needs. these features are : dual clock mode which allows the device to run on very low power saving frequency pattern detecting application function which is used in a serial transmission to count wav e form width width modulation that can generate a duty-cycle-programmable signal ad converter with up to 10 bits resolution. 2 features low-cost solution for low-speed usb devices, such as mouse, joystick, and gamepad. usb specification compliance universal serial bus specification version 1.1 usb devic e clas s definition for human interfac e devic e (hid), firmware specification version 1.1 support 1 device address and 2 endpoints usb application usb protocol handling usb device state handling identifies and decodes standard usb commands to endpoint zero auto-detects ps/2 or usb port built-in ps/2 port interface
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 3 built-in 8-bit risc mcu 5 level stacks for subroutine and interrupt 8 available interrupts 8-bit real time clock/counter (tcc) with overflow interrupt built-in rc oscillator free running for watchdog timer and dual clock mode two independent programmable prescalers for wdt and tcc two methods of power saving : 1. power-down mode (sleep mode) 2. low frequency mode. two clocks per instruction cycle multi-time programmable i/o ports up to 15 general purposes i/o pins grouped into two ports (port 6 and 7). up to 2 led sink pins each gpio pin of ports 6 has an internal programmable pull-high resistor (200k ohms) each gpio pin wakes up the mcu fr om sleep mode by input state change internal memory built-in 2048k*13 bits program rom built-in 112 bytes general purpose registers (sram) built-in usb application fifos. built-in 4 bytes e 2 prom (em78m612 b, em78m612 d) operation frequency normal mode : mcu runs on the external oscillator frequency dual clock mode : mcu runs at the frequency of 256khz (or 32khz, 4khz, 500hz), emitted by the internal oscillator with t he external ceramic resonator (or crystal) turned off to save power. built-in pattern detecting application for serial signal transmission built-in pulse width modulation (pwm) up to 2 channels pwm function on p.64 (pwm1) and p.65 (pwm2). up to 8-bit resolution pwm output up to 8 selections of duty cycles built-in 15-channel analog-to-digital converter (adc) built-in ad converter with 10-bit resolution
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 4 4 adc conversion rates : 256k/128k/64k/32k built-in 3.3v voltage regulator for mcu power supply pull-up source for the external usb resistor on d-pin. package type 16 pin pdip/sop (em78m612(a/b/c/d) a p/m) 18 pin pdip/sop (em78m612(a/b/c/d) b p/m) 20 pin pdip/sop (em78m612(a/b/c/d) c p/m) 20 pin ssop (em78m612(a/b/c/d) em) 24 pin pdip/sop (em78m612(a/b/c/d) d p/m) 24 pin ssop (em78m612(a/b/c/d) fm) 3 type definition the em78m612 series has sereval types of pack aging. each type is divided into 4 modules, namely; original, with e 2 prom, with a/d converter, and with both e 2 prom and a/d converter. hence, packaging configuration for each series is defined. the table 3.1 below summarizes which series of the em78m612 belong to which module. original with e 2 prom with a/d converter with both em78m612a em78m612b em78m612c em78m612d table 3-1 packaging summary of em78m612 series ic
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 5 4 applications this microcontroller is designed for u sb low speed device application or non-usb embedded device. it is also suitable for ps/2 mouse application. 5 pin configuration p61 1 16 p60/v pp p62 2 15 p64 p63 3 14 p65 p70 4 13 p71 v ss 5 12 d+/p50 v nn 6 11 d-/p51 v 3.3v 7 10 v dd osci 8 9 osco em78m612xap p60/v pp 1 20 p64 p61 2 19 p65 p62 3 18 p66 p63 4 17 p67 p70 5 16 p71 p72 6 15 p73 v ss 7 14 d+/p50 v nn 8 13 d-/p51 v 3.3v 9 12 v dd osci 10 11 osco em78m612xcp p60/v pp 1 18 p64 p61 2 17 p65 p62 3 16 p66 p63 4 15 p67 p70 5 14 p71 v ss 6 13 d+/p50 v nn 7 12 d-/p51 v 3.3v 8 11 v dd osci 9 10 osco em78m612xbp p60/v pp 1 24 p64 p61 2 23 p65 p62 3 22 p66 p63 4 21 p67 p70 5 20 p71 p72 6 19 p73 p74 7 18 p75 p76 8 17 p77 v ss 9 16 d+/p50 v nn 10 15 d-/p51 v 3.3v 11 14 v dd osci 12 13 osco em78m612xdp
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 6 6 pin description symbol i/o function osci i 6mhz / 12mhz ceramic resonator or crystal input. osco i/o return path for 6-mhz / 12m hz ceramic resonator or crystal. v nn used in programming the on-chip rom. during normal operation, this pin is connected to ground. v 3.3v o 3.3v dc voltage output from internal regul ator. this pin has to be tied to a 4.7 f capacitor. p60/v pp i p60 functins as an input pin only (no output) for serial signal transmission application, the pin p60 is used as a serial signal input pin. for detailed usage and f unction, refer to section 8.8, pattern detecting application of this spec. p61 ~ p67 i/o 7 giop pins. the pull high resistors (200k ohms) and pull low resistors (15k ohm) are selected through pin programming. all port6 i/o pins are used for ad func tion. furthermore,p64 & p65 can also be used for pwm function. p70 ~ p77 i/o port7 offers up to 8 giop pins. the sink current of p70 & p71 are programmable for driving led. each pin has pull high resistors (200k ohm) that can be selected through pin programming. all port7 i/o pins can be used for ad function. d+ / p50 i/o usb plus data line interface or ps/2 line interface are user-defined through firmware setting. when this pin is used as a ps/2 line inte rface, it will generat e an interrupt when its state changes. d- / p51 i/o usb minus data line interface or ps/2 line interface are user-defined through firmware setting. when this pin is used as a ps/2 line inte rface, it will generat e an interrupt when its state changes. v dd - connects to the usb power source or to a nominal 5v-power supply. actual v dd range can vary between 4.4v and 5.2v. v ss - connects to ground. table 7.1 pin descriptions
em78m612 universal serial bus microcontroller series this spe c ifica t ion may cha nge with out furthe r notice . 2004/4/2 8 v1 .1 7 7 function block diagram os ci l l a t o r ti m i n g c ont r o l bu ilt - i n rc p r esc al e r r1 (t c c ) wdt ti m e r da t a & co nt ro l bus osc i os c o r2 (p c ) st ac k1 al u ac c r3 (s ta tu s) ro m in s t r u c t i o n re gi s t e r in s t r u c t i o n de c o de r in t e r r u p t co nt ro l re s e t & sl ee p & wa k e u p con t r o l 3. 3v re g u l a t o r us b d e vi ce c o nt ro lle r vd d v 3 . 3 t r an sc e i v e r d+ d - tc c wdt ra m r4 (r sr ) st ac k2 st ac k3 st ac k4 st ac k5 ee pr o m p r e sca l e r i/o po r t 6 p 60/ p d a p 61/ a d p 62/ a d p 83/ a d p 64/ a d p 65/ a d p 66/ a d p 67/ a d pa t t e r n de t e c t a p p l i cat i o n ad c pw m i/o po r t 7 p 70/ a d p 71/ a d p 72/ a d p 73/ a d p 74/ a d p 75/ a d p 76/ a d p 77/ a d i/o po r t 5 p5 0 / d + p5 1 / d - f i gure 7 em78m612 series f unction block diagram 8 function description the em78m612 memory is organized into 4 s paces, namely; user program memory in 2048*13 bits rom space, data memory in 112 bytes sram space, and usb application fifos (for endpoint0 and endpoi nt1). furthermore, several registers are used for special purposes.
em78m612 universal serial bus microcontroller series this spe c ifica t ion may cha nge with out furthe r notice . 2004/4/2 8 v1 .1 8 8.1 program memory the program space of the em78m612 is 2k by tes, and is divided into two pages. each page is 1k bytes long. after reset, the 11-bit program counter (pc) points to location zero of the program space. it has two interrupt vectors, i.e., interrupt vectors at 0x0001 and usb application interrupt vectors at 0x000a. the interrupt vector applies to tcc interrupt, high pattern detecting interrupt, low pattern detecting interrup t, and port 5 state changed interrupt. the usb application interrupt vector is for usb endp oint zero interrupt, u sb suspend interrupt, usb reset interrupt ,and usb host resume interrupt. after an interrupt, the mcu will fetch the next instruction from the corresponding address as illustrated in the following diagram. a f t e r r e s e t a d d r e s s 0x0000 reset v e ct or 0x0001 interrupt v e c t or 0x000a usb application interrupt v e ctor 0x03ff page 0 0x0400 0x07ff page 1 pc 8.2 dat a memory the data memory has 112 bytes sram space. it is also equipped with usb application fifo space for usb application. the figure 8.1 (next page) shows the organization of the data memory space.
em78m612 universal serial bus microcontroller series this spe c ifica t ion may cha nge with out furthe r notice . 2004/4/2 8 v1 .1 9 8.2.1 s p ecial purpose registers when the microcontroller executes instruction, specific register s are invoked for assistance, such as; status register which records the ca lculation status, port i/o control registers which control the i/o pins? direction, etc. t he em78m612 series provides a lot more of other special purpose registers wi th different func tions . there are 23 special operation registers which are located from address 0x00 to 0x0e in bank0, and from address 0x08 to 0x0f in b ank1. on other hand, 17 more special control registers are available to control functions or i/o direction. these are arranged from address 0x05 to 0x0f in bank0, and fr om address 0x08 to 0x0f in bank1. note that special control registers can only be read or written by two instructions; ior and iow. to access registers from bank1, the spec ial purpose registers bank selector (r3[7]) should be set first. r 0 ( i ndi r e c t i o n a ddr e s s i ng r e gi s t e r ) r1 ( t i m e c l oc k / co un t e r re gi s t e r ) r 2 ( p r ogr a m c ount e r ) & s t a c k r 3 (s ta tu s r e g i s t e r ) r 4 ( r a m s e l ect r e g i st e r ) cb k0 r 5 ( d a t a lin e i/o r e g i s t e r ) r 6 (p o r t 6 i / o r e g i s t e r ) r 7 (p o r t 7 i / o r e g i s t e r ) r 8 ( p or t 6 w a k e up pi n s e l e c t i on r e g i s t e r ) r 9 ( p or t 7 w a k e up pi n s e l e c t i on r e g i s t e r ) r a ( h i gh p a t t e r n c ount e r r e gi s t e r ) r b (l o w p a tte r n c o u n te r r e g i s t e r ) r c ( u s b a p p l i c a t i on s t a t us r e gi s t e r ) r d ( u s b fi f o a ddr e s s r e gi s t e r ) r e ( u s b fi f o da t a r e gi s t e r ) r f ( i nt e r r u p t s t a t us r e gi s t e r ) cb k1 r8 s ( p w m 1 du t y cy c l e re g i s t e r ) r9 s ( p w m 2 du t y cy c l e re g i s t e r ) ra s ( a d ch a n n e l s e l e c t re g i s t e r ) rbs ( a d m s b da t a r e g i s t e r 00 01 02 03 04 05 06 07 08 rcs ( a d l s b da t a re g i s t e r ) r es ( e epr o m m o d e sel ec t r e g i st e r ) g e ne r a l p u r pos e re gi s t e r 09 0a 0b 0c 0d 0f 08 09 0e 0a 0b 0c 0d 0e 10 0f cbk0 io c 5 ( p o r t 5 i/o c o n t ro l r e g i s t e r ) io c 6 ( p o r t 6 i/o c o n t ro l r e g i s t e r ) io c 7 ( p o r t 7 i/o c o n t ro l r e g i s t e r ) io c 8 ( s in k c u r e n t c o n t r o l r e g i s t e r ) i o c9 ( p da co n t r o l re g i s t e r ) i o c a ( o pe r a t i on m o d e c ont r o l r e g i s t e r ) io c b ( p o r t 6 p u ll l o w c o n t r o l r e g i s t e r ) i o c c ( p or t 6 pul l h i gh c o n t r o l r e gi s t e r ) i o c d ( p or t 7 pul l hi gh c ont r o l r e gi s t e r ) i o c e ( s p e c i a l f unc t i o n c ont r o l r e gi s t e r ) i o c f ( i nt e r r upt m a s k r e gi s t e r ) cbk1 io c 8 s ( p w m c o n t r o l r e g i s t e r ) i o ca s ( a d co nt r o l re g i s t e r ) i o cc s ( e e p r o m by t e 0 ) i o c d s ( e epr om by t e 1 ) i o c es ( eepr o m by t e 2 ) i o c f s ( eepr o m by t e 3 ) ep0' s fi fo ep1' s fi fo d a ta b y te p o i n te r o f e p 0 00 01 10 1f 20 g e n e ra l p u rp o s e re g i s t e r s (b a n k 0 ) g e n e ra l p u rp o s e re g i s t e r s (b a n k 1 ) g e ne r a l p u r pos e re g i s t e r s (b a n k 2 ) 3f d a ta b y te p o i n te r o f e p 1 11 by t e 0 by t e 1 by t e 2 by t e 3 by t e 4 by t e 5 by t e 6 by t e 7 f i g 8.1 t he organization of em78m612 data ram
em78m612 universal serial bus microcontroller series this spe c ifica t ion may cha nge with out furthe r notice . 2004/4/2 8 v1 .1 10 8.2.1.1 operation registers in bank 0 the following introduces each of the operat ion registers under the special purpose registers in bank 0. these operation regi sters are arranged according to the order of registers? address. note that some regist ers are read only, while others are both readable and writable. r0 (indirect address register) default value : (0b_0000_0000) r0 is not a physically implemented register. its major function is to be an indirect address pointer. any instruction using r0 as a pointer act ually accesses t he data pointed by the ram select register (r4). r1 (time / clock counter) default value : (0b_0000_0000) this register tcc, is an 8-bit timer or counter. it is readable and writable as any other register. after power-on reset and watchdog reset, the in itial value of this register is 0x00. r2 (program counter & stack) default value : (0b_0000_0000) the em78m612 program counter is an 11-bit long regi ster that allows access to 2k bytes of program memory. the program counter is cl eared after power-on reset or watchdog reset. the first instruction that is executed a fter a reset is located at address 00h. 0x0400 0x07f f page 1 0x03f f page 0 0x000 a 0x0001 0x0000 usb interrupt v e ctor r2 [ 9 ] ~ r2 [ 0 ] interrupt v e ctor ret ret l ret i call s t ack 5 s t ack 4 s t ack 3 s t ack 2 s t ack 1 reset v e ctor r3 [ 5 ]
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 11 r3 (status register) default value : (0b_0001_1000) 7 6 5 4 3 2 1 0 sprbs - ps0 t p z dc c r3 [0] carry flag. r3 [1] auxiliary carry flag. r3 [2] zero flag. it will be set to 1 when the result of an arithmetic or logic operation is zero. r3 [3] power down flag. it will be set to 1 during power-on phase or by ?wdtc? command and cleared when the mcu enters into power down mode. it remains in its previous state after watchdog reset. 1: power-on. 0: power down r3 [4] time-out flag. it will be set to 1 during power-on phase or by ?wdtc? command. it is reset to 0 by wdt time-out. 1: watchdog timer without overflow. 0: watchdog timer with overflow. the various states of power down flag and time -out flag at different conditions are shown below: t p condition 1 1 0 1 1 1 1 *p 0 0 power-on reset wdtc instruction wdt time-out power down mode wakeup caused by port change during power down mode *p: previous status before wdt reset r3 [5] page selection bit. this bit is used to select a page of program memory (refer to r2, program counter). ps0 program memory page [address] 0 page 0 [0000-03ff] 1 page 1 [0400-07ff] r3 [6] general purpose registers. r3 [7] special purpose registers bank selector. 1: r8s ~ rfs; ioc8s ~ iocfs 0: r5 ~ rf; ioc5 ~ iocf
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 12 r4 (ram select register) default value : (0b_0000_0000) 7 6 5 4 3 2 1 0 bk1 bk0 ad5 ad4 ad3 ad2 ad1 ad0 r4 (ram select register) contains the address of the registers. r4 [0~5] are used to select registers in 0x00h~0x3fh. the address 0x00~0x1f is common space. after 0x1fh, sram is grouped into four banks. r4 [6,7] are used to select register banks. to select a registers bank, refer to the following examples and the table below : (1) r4=00001100 and r4=01001100 point to the same register 0x0ch. since 0x0ch is in the common space, bit 6 and bit 7 are meaningless. (2) r4=10111100 points to the register 0x3c in bank 2. r4[7]bk1 r4[6]bk0 ram bank # 0 0 1 1 0 1 0 1 bank 0 bank 1 bank 2 bank3 r5 (data line i/o register) default value : (0b_0000_0000) 7 6 5 4 3 2 1 0 - - - - - - d- or ps/2 d+ or ps/2 r5 [0] d+ line register or ps/2 clock interface register. r5 [1] d- line register or ps/2 data interface register. these two bits are both writable and readable when the mcu is operating under ps/2 mode. but under usb mode, these two bits cannot be accessed. r5 [2~7] general purpose registers. r6 (port 6 i/o register) default value : (0b_0000_0000) 7 6 5 4 3 2 1 0 p67 p66 p65 p64 p63 p62 p61 p60 r7 (port 7 i/o register) default value : (0b_0000_0000) 7 6 5 4 3 2 1 0 p77 p76 p75 p74 p73 p72 p71 p70 r8 (port 6 wake-up pin selection register) default value : (0b_1111_1111) 7 6 5 4 3 2 1 0 /wu87 /wu86 /wu85 /wu84 /wu83 /wu82 /wu81 /wu80
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 13 r8 [0 ~ 7] select which of the port 6 pins are to be defined to wake-up the mcu from sleep mode. when the state of the select ed pins changes during sleep mode, the mcu will wake-up and execute the next instruction automatically. 1: disable the wake-up function 0: enable the wake-up function r9 (port 7 wake-up pin selection register) default value : (0b_1111_1111) 7 6 5 4 3 2 1 0 /wu77 /wu76 /wu76 /wu74 /wu73 /wu72 /wu71 /wu70 r9 [0 ~ 7] select which of the port 7 pins are to be defined to wake-up the mcu from sleep mode. when the state of the select ed pins changes during sleep mode, the mcu will wake-up and execute the next instruction automatically. 1: disable the wake-up function 0: enable the wake-up function ra (high pattern counter register) default value : (0b_0000_0000) 7 6 5 4 3 2 1 0 hp.7 hp.6 hp.5 hp.4 hp.3 hp.2 hp.1 hp.0 this register is used in pattern detecting applicat ion. if this function is disabled (ioce[2] = 0), the pda function is disabled. ra register is also used as a general-purpose register. rb (low pattern counter register) default value : (0b_0000_0000) 7 6 5 4 3 2 1 0 lp.7 lp.6 lp.5 lp.4 lp.3 lp.2 lp.1 lp.0 this register is used in pattern detecting applicat ion. if this function is disabled (ioce[2] = 0), the pda function is disabled. rb register is also used as a general-purpose register. rc (usb application status register) default value : (0b_0000_0000) 7 6 5 4 3 2 1 0 ep0_w ep0_r ep1_r 0 device_resum e host_suspend ep0_busy stall rc [0] stall flag. when mcu receives an unsupported command or invalid parameters from host, this bit will be set to 1 by t he firmware to notify the udc to return a stall handshake. when a successful setup tr ansaction is received, this bit is cleared automatically. this bit is both readable and writable. rc [1] ep0 busy flag. when this bit is equal to ?1,? it indicates that the udc is writing data into the ep0?fifo or reading data from it. during this time, the firmware will avoid accessing the fifo until udc finishes writing or reading. this bit is only readable.
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 14 rc [2] host suspend flag. if this bit is equal to 1, it indicates that usb bus has no traffic for the specified period of 3.0 ms. this bit will also be cleared automatically when a bus activity takes place. this bit is only readable. rc [3] device resume flag. this bit is set by firmware to general a signal to wake-up the usb host and is cleared as soon as the usb suspend signal becomes low. this bit can only be set by firmware and cleared by the hardware. rc [4] undefined register. the default value is 0. rc [5,6] ep0_r / ep1_r flag. these two bits inform the udc to read the data written by firmware from the fifo. then the udc s ends the data to the host automatically. after udc finishes reading the data from the fifo, this bit is cleared automatically. therefore, before writing data into the fifo, the firmware will first check this bit to prevent overwriting the ex isting data. these two bits can only be set by the firmware and cleared by the hardware. rc [7] ep0_w flag. after the udc completes writing data to the fifo, this bit will be set automatically. the firmware will clear it as soon as it gets the data from ep0?s fifo. only when this bit is cleared that the udc will be able to write a new data into the fifo. therefore, before the firmware can write a data into the fifo, this bit must first be set by the firmware to prevent udc from writing data at the same time. this bit is both readable and writable.
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 15 rd (usb application fifo address register) default value : (0b_0000_0000) 7 6 5 4 3 2 1 0 0 0 0 uad4 uad3 uad2 uad1 uad0 rd [0~4] usb application fifo address registers. these five bits are the address pointer of usb application fifo. rd [5~7] undefined registers. the default value is zero. re (usb application fifo data register) default value : (0b_0000_0000) 7 6 5 4 3 2 1 0 ud7 ud6 ud5 ud4 ud3 ud2 ud1 ud0 re (usb application fifo data register) contai ns the data in the register of which address is pointed by rd. rf (interrupt status register ) default value : (0b_0000_0000) 7 6 5 4 3 2 1 0 low signal_if high signal_if port 5 state change_if usb host resume_if usb reset_if usb suspend_if ep0_if tcc_if rf [0] tcc overflow interrupt flag. it will be set while tcc overflows, and is cleared by the firmware. rf [1] endpoint zero interrupt flag. it will be set when the em78m612 receives vender /customer command to endpoint zero. this bit is cleared by the firmware. rf [2] usb suspend interrupt flag. it w ill be set when the em78m612 finds the usb suspend signal on usb bus. this bit is cleared by the firmware. rf [3] usb reset interrupt flag. it will be set when the host issues the usb reset signal. rf [4] usb host resume interrupt flag. it is set only under dual clock mode when the usb suspend signal becomes low. rf [5] port 5 state change interrupt flag. it is set when the port 5 state changes. rf [6, 7] high/low signal counter interrupt flag. these two flags are used for pattern detecting application. r10~r1f are general purpose registers. these registers can be used no matter what bank selector is. there are 3 banks(bk0~bk2) r20~r3f general purpose registers, select by r4 [6 7].
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 16 8.2.1.2 operation registers in bank 1 the special purpose registers for special oper ation (r8s~res), are located in special purpose register bank 1. to access these regi sters, bank selector (r3[7]) must be set first. these bank 1 located registers serve special functions, such as; e 2 prom, plus width modulation, and analog to digital converter. these registers and special functions are described in details in sections 8.2.3, 8.9, and 8.10 respectively in this specification. r8s ( pwm1 duty cycle register) default value (0b_0000_0000) a specified values keeps the output of pwm1 stay at high in a period. r9s ( pwm2 duty cycle register) default value (0b_0000_0000) a specified values keeps the output of pwm2 stay at high in a period. ras (ad channel select register) default value (0b_0000_0000) 7 6 5 4 3 2 1 0 adc token_bit 0 ad4 ad3 ad2 ad1 ad0 ras [0]~[4]:ad channel selector ad4 ad3 ad2 ad1 ad0 channel i/o port 0 0 0 0 0 disable ad - 0 0 0 0 1 1 reserved 0 0 0 1 0 2 p61 0 0 0 1 1 3 p62 0 0 1 0 0 4 p63 0 0 1 0 1 5 p64 0 0 1 1 0 6 p65 0 0 1 1 1 7 p66 0 1 0 0 0 8 p67 0 1 0 0 1 9 p70 0 1 0 1 0 10 p71 0 1 0 1 1 11 p72 0 1 1 0 0 12 p73 0 1 1 0 1 13 p74 0 1 1 1 0 14 p75 0 1 1 1 1 15 p76 1 0 0 0 0 16 p77
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 17 ras [6] token_bit will be latched to high by hardware when usb bus is transferring token packet. this bit reset by firmware only. ras [7] ad converter ready flag. 0->1 start ad converting.(bit set by firmware) 1->0 when ad finish converting and moving digital data into ad data register , this bit is clear by hardware. p.s.: hardware enable this function only at ad channel selector on the functional i/o port. rbs (ad msb data register) ad digital data msb 8 bits 7 6 5 4 3 2 1 0 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 this register is read only. rcs (ad lsb data register) ad digital data lsb 2 bits 7 6 5 4 3 2 1 0 bit 1 bit 0 - - - - - - this register is read only. res (eeprom mode select register) default value ( 0b_0000_0000) command value action execution time 0b_0000_0000 read 1ms 0b_0000_0001 write 9ms 0b_0000_0010 erase 128ms 0b_0000_0011 disable n.a.
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 18 8.2.1.3 control registers in bank 0 special purpose registers for special control pur poses are also available. except for the accumulator (a), these registers must be read and written by special instructions. one of these registers, cont, can only be read by the instruction "contr" and written by "contw" instruction. the remaining special c ontrol registers can be r ead by the instruction "ior" and written by the instruction "iow." the following paragraphs only describe the general functions of the control registers. for more detailed description, refer to se ctions 8.8 to 8.10 of this spec. a (accumulator register) the accumulator is an 8-bit register that holds operands and results of arithmetic calculations. it is not addressable. cont (control register) default value : (0b_0011_1111) 7 6 5 4 3 2 1 0 0 /int tsr2 tsr1 tsr0 psr2 psr1 psr0 [note] the cont register can be read by the instruction "contr" and written by the instruction ?contw." cont [0~2] watchdog timer prescaler bits. thes e three bits are used as the prescaler of watchdog timer. cont [3~5] tcc timer prescaler bits. the relationship between the prescaler value and these bits are as shown below: psr2/tsr2 psr1/tsr1 psr0/tsr0 tcc rate wdt rate 0 0 0 1: 2 1: 1 0 0 1 1: 4 1: 2 0 1 0 1: 8 1: 4 0 1 1 1: 16 1: 8 1 0 0 1: 32 1: 16 1 0 1 1: 64 1: 32 1 1 0 1: 128 1: 64 1 1 1 1: 256 1: 128
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 19 cont [6] interrupt enable control bit. this bit toggles interrupt function between enable and disable. it is set to 1 by the interrupt disable instruction "disi" and reset by the interrupt enable instructions "eni" or "reti." 0: enable the interrupt function. 1: disable the interrupt function. cont [7] undefined register. the default value is one. ioc5 ~ioc7 (i/o port [port 5 ~ po rt 7] direction control registers each bit controls the i/o direction of three i/o ports respectively. when these bits are set to 1, the relative i/o pins become input pins. si milarly, the i/o pins becomes outputs when the relative control bits are cleared. 1: input direction. 0: output direction. ioc5 (data line i/o control register) default value : (0b_0000_0011) 7 6 5 4 3 2 1 0 0 0 0 0 0 0 i/o i/o ioc5 [2~7] undefined registers. the default value is 0. ioc6 (port 6 i/o control register) default value : (0b_1111_1111) 7 6 5 4 3 2 1 0 p67 p66 p65 p64 p63 p62 p61 1 ioc6 [0] this bit is always 1. this is because p60 can only be used as an input pin. ioc7 (port 7 i/o control register) default value : (0b_1111_1111) 7 6 5 4 3 2 1 0 p77 p76 p75 p74 p73 p72 p71 p70
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 20 ioc8 (sink current control register) default value : (0b_0000_0000) 7 6 5 4 3 2 1 0 0 0 sink1.1 sink1.0 0 0 sink0.1 sink0.0 ioc8 [0,1][4,5] are p70/p71 sink current cont rol registers. four levels are offered for selection : sink0.1/1.1 sink0.0/1.0 sink current 0 0 3ma 10% 0 1 6ma 10% 1 0 12ma 10% 1 1 30ma 10% the default current after power-on reset is 3ma. ioc9 (pattern detecting application control register) default value (0b_0111_0000) 7 6 5 4 3 2 1 0 0 sample time.2 sample time.1 sample time.0 0 db.2 db.1 db.0 ioc9 [0~2] deboucing control registers. this is used for pattern detecting application. there are seven degrees available to debounce the input signal noise. ioc9 [4~6] sample time selection registers. th is is used for pattern detecting application. the default value is 111. sample time.2 sample time.1 sample time.0 sample rate ( divide the frequency of external oscillator by ) 0 0 0 1 0 0 1 2 0 1 0 4 0 1 1 8 1 0 0 16 1 0 1 32 1 1 0 64 1 1 1 128 ioc9[3&7] undefined register. the default value is zero.
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 21 ioca (operation mode control register) default value : (0b_1100_0000) 7 6 5 4 3 2 1 0 dual_frq.1 dual_frq.0 0 0 0 0 ps/2 usb ioca [0,1] these two bits are used to select the operation mode. em78m612 can auto-detect the type of port device being a ttached. after identifying the port, the firmware will set these two bits to enter into a proper operation mode. the definition of these two control regist ers is described in the table below. ioca[1] ioca[0] operation mode 0 0 detect mode 0 1 usb mode 1 0 ps/2 mode 1 1 usb test mode ioca [2~5] undefined registers. the default value is 0. ioca [6,7] select the operation frequency in dual clock mode. four frequencies are available and can be chosen as dual clock mode for running the mcu program. dual_frq.1 dual_frq.0 frequency 0 0 500hz 0 1 4khz 1 0 32khz 1 1 256khz iocb (port 6 pull-low control register) default value : (0b_0000_0000) 7 6 5 4 3 2 1 0 pl67 pl66 pl65 pl64 pl63 pl62 pl61 - iocb [0~7] select whether the 15k ohm pull- low resistor of port 6 individual pin is connected or not. 1: enable the pull-low function. 0: disable the pull-low function. p60 without pull low resistor. iocc (port 6 pull-high control register) default value : (0b_0000_0000) 7 6 5 4 3 2 1 0 ph67 ph66 ph65 ph64 ph63 ph62 ph61 - iocc [0~7] select whether the 200k ohm pull-hi gh resistor of port 6 individual pin is connected or not.
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 22 1: enable the pull-high function. 0: disable the pull-high function. p60 without pull high resistor iocd (port 7 pull-high control register) default value : (0b_0000_0000) 7 6 5 4 3 2 1 0 ph77 ph76 ph75 ph74 ph73 ph72 ph71 ph70 iocd [0~7] select whether the 200k ohm pull-hi gh resistor of port 7 individual pin is connected or not. 1: enable the pull-high function. 0: disable the pull-high function. ioce (special function control register) default value : (0b_1111_0000) 7 6 5 4 3 2 1 0 /dual clock /wue wte run 0 pda na na ioce [2] pattern detecting application enable bit. this bit enables the pattern detecting function which is used in t he serial signal transmission. when this feature is enabled, p60 becomes a serial input pin allowing one pattern detecting block, a counter, and two comparators to function. 1: enable 0: disable ioce [3] undefined register. the default value is zero. ioce [4] run bit. this bit can be cleared by the firmware and set during power-on, or by the hardware at the falling edge of wake -up signal. when this bit is cleared, the clock system is disabled and the mcu enters into power down mode. at the transition of wake-up signal from high to low, this bit is set to enable the clock system. 1: run mode. the em78m612 is working normally. 0: sleep mode. the em78m612 is in power down mode. ioce [5] watchdog timer enable bit. the bit disable/enables the watchdog timer. 1: enable wdt. 0: disable wdt. [note] if the code option wtc bit is "0,? wdt is always disabled. ioce [6] enable the wake-up function as triggered by port-change. this bit is set by udc. 1: disable the wake-up function. 0: enable the wake-up function.
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 23 ioce [7] dual clock control bit. this bit is used to select the frequency of system clock. when this bit is cleared, the mcu w ill run on very low frequency save power and the udc will stop working. 1: selects em78m612 to run on normal frequency. 0: selects to run on slow frequency. iocf (interrupt mask register) default value : (0b_0000_0000) 7 6 5 4 3 2 1 0 low signal_ie high signal _ie port 5 state change_ie usb host resume_ie usb reset_ie usb suspend_ie ep0_ie tcc_ie iocf [0~7] tcc / ep0 / usb suspend / usb re set / usb host resume / port 5 state change / high signal / low signal interrupt enable bits. these eight bits respectively control the function of tcc interrupt, ep0 interrupt, usb suspend interrupt, usb reset interrupt, usb ho st resume interrupt, port5 state change interrupt, high pattern counter interrupt and low pattern counter interrupt. individual interrupt is enabled by setting its associated control bit in the iocf to "1". 1: enable interrupt. 0: disable interrupt. only when the global interrupt is enabled by the eni instruction that the individual interrupt will work. after disi instruction, any interrupt w ill not work even if the respective control bits of iocf are set to 1. the usb host resume interrupt works only under dual clock mode. this is because when the mcu is under sleep mode, it will be waked up by the udc resume signal automatically.
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 24 8.2.1.4 control registers in bank 1 bank 1 offers more of the special purpose contro l registers. to write or read these registers, the bank selector (r3[7]) must be initially set to 1. for more detailed description of these registers, refer to sections 8.8 to 8.10 of this spec. ioc8s (pwm control register) default value (0b_0000_0111) 7 6 5 4 3 2 3 2 pen2 pen1 - - - ps2 ps1 ps0 ioc8s [0~2] pwm clock prescaler fosc = 6mhz (no matter xtal is 6mhz or 12mhz) ps2 ps1 ps0 clock(hz) period/255 0 0 0 fosc/3 0.5us 0 0 1 fosc/6 1us 0 1 0 fosc/12 2us 0 1 1 fosc/24 4us 1 0 0 fosc/48 8us 1 0 1 fosc/96 16us 1 1 0 fosc/192 32us 1 1 1 fosc/384 64us ioc8s [6] pwm1 enable bit 0:disable 1:enable ioc8s [7] pwm2 enable bit 0:disable. 1:enable iocas (ad control register) default value (0b_0000_0000) 7 6 5 4 3 2 1 0 - - - - - - adps1 adps0 iocas [0,1]:ad clock prescaler adps1 adps0 ad clock source conversion rate 0 0 rc 20k 0 1 rc/2 10k 1 0 rc/4 5k 1 1 rc/8 2.5k
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 25 8.2.2 usb application fifos for usb application, em78m612 provides an 8-byte first-in-first-out (fifo) buffer for each endpoint. the buffer cannot be accessed directly. however, a corresponding data byte pointer register for each endpoint is made ava ilable to address the individual byte of the fifo buffer. the content of the individual byte will map to a special register. 8.2.3 e 2 prom four bytes of e 2 prom are located in the iocc ~ iocf of control register bank 1. the stored data of e 2 prom are not erased when the power is off and can be read and rewritten by firmware. in some special case of applicat ions, for example, cordless mouse controller, e 2 prom can store important data, such as the cordless mouse?s device identification number. a control register, res (address : 0x0e in bank1) controls the e 2 prom, that is, to read, write, or to erase the data from e 2 prom. writing a command into this register will execute an action to e 2 prom. the command value is defined in the following table. note that there is an execution time lapse for each command. before writing the next command into the control register, allow enough time for the e 2 prom to finish processing the previous command. command value action execution time 0b_0000_0000 read 1ms 0b_0000_0001 write 9ms 0b_0000_0010 erase 128ms 0b_0000_0011 disable n/a 8.3 i/o ports the em78m612 has up to fifteen general purposes i/o pins, which are classifies into two port groups; port 6 and port 7. each pin has an internal resistor that can be individually selected by user. notice that pin 60 is a input only pin.the following describes the important features of em78m612 i/o pins. 8.3.1 programmable large current port 7 has two pins; p70 and p71 that can drive large current of up to 30ma. the range of driving current is from 3ma to 30ma, which is programmable. use ioc8 [0,1] and ioc8 [4,5] to control the sink current of p 70/p71. the default current is 3ma.
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 26 8.3.2 wakeup by port change function each of the gpio pins in port 6 and port 7 can wakeup the mcu through signal change from input pin. this function is used to wake-up the mcu automatically from sleep mode. it also supports the remote wake- up function for usb application. any of the individual pins of port 6 and port 7 can be defined to wakeup the mcu by setting their respective bits, r8 and r9. 8.4 usb application em78m612 is specially designed for usb dev ice application and has many powerful functions that help the firmware to free itself from complex situation in various aspects of usb application. 8.4.1 auto-detect ps/2 or usb mode when the em78m612 is connected to the bus, it will auto-detect and identify which type of bus (usb or ps/2) it is connec ted to. the conditions that in fluence auto-detect function are described below : 1. after a power-on reset, the initial value of ioca [0,1] is 0b00. thus the operation mode is ?detect mode? and the d+ and d- i/o pins are internal pulled high by 200k ohm to v dd . 2. the firmware checks the state of r5 [0,1]. if the state with which these two bits is 0x00, set the ioca [0] to ?1? to define the ?usb mode.? otherwise, set the ioca [1] to ?1,? to define ?ps/2 mode.? 3. when the operation mode is defined as ?usb mode,? the d- i/o pin is internal pulled high by a 1.5k ohm resistor to 3.3v, which is output from a built-in regulator. 4. if the operation mode is in ?ps/2 mode,? both of the ps/2 interface i/o pins are internal pulled high by a 4.7k ohm resistor to v dd . {note] if the auto-detect function is not used, t he firmware should set the operation mode, either in usb mode or ps/2 mode, at the beginning of program. an additional mode, ?usb test mode? is also available. this mode has no load on d+ and d- i/o pins, and can only be used in usb applicat ion case. therefore, an external 1.5k ohm resistor is needed to pull up d- i/o pin to 3.3v. under ?ps/2 mode,? both ps/2 pins are progr ammed to generate an interrupt. after setting the port 5 state change to interrupt enable bit, t he mcu will interrupt while the state of these two pins changes.
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 27 8.4.2 usb device controller the usb device controller (udc) built-in in the em78m612 can interpret the usb standard command and response automatically without involving firmware. the embedded series interface engine (sie) handles the serializ ation and deserialization of actual usb transmission. thus, a developer can concentrate his efforts more in perfecting the device actual functions and spend less energy in dealing with usb transaction. the udc handles and decodes most standard usb commands defined in the usb specification rev1.1. if udc receives an unsuppor ted command, it will set a flag to notify mcu the receipt of such command. the standard commands that em78m612 supports includes; clear feature , get configuration , get interface, get status , set address , set configuration , set feature, and set interface . each time udc receives a usb command, it writes the command into ep0?s fifo. only when it receives unsupported command that the udc will notify the mcu through interrupt. therefore, em78m612 is very flexible under usb application because the developer can freely choose the method of decoding the usb co mmand as dictated by different situation. 8.4.3 device address and endpoints em78m612 supports one device address, two endpoi nts, ep0 for control endpoint, and ep1 for interrupt endpoint. sending data to usb host in em78m612 is very easy. just write data into ep?s fifo, then set flag, and the udc will handle the rest. it will then confirm that the usb host has received the correct data from em78m612. 8.5 reset the em78m612 provides three types of reset : (1) power-on reset, (2) watchdog reset, and (3) usb reset. 8.5.1 power-on reset power-on reset occurs when the device is attac hed to power and a reset signal is initiated. the signal will last until the mcu becomes stable. after a power-on reset, the mcu enters into following predetermined states (see below), and then, it is ready to execute the program. a. the program counter is cleared. b. the tcc timer and watchdog timer are cleared. c. special registers and special control r egisters are all set to initial value. the mcu also has a low voltage detector that detects low output power condition. whenever the output voltage of the 3.3v regulator decreases to below 2.2v, a reset signal is set off.
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 28 8.5.2 watchdog reset when the watchdog timer overflows, it causes the watchdog to reset. after it resets, the program is executed from the beginning and some registers will be reset. the udc however, remains unaffected. 8.5.3 usb reset when udc detects a usb reset signal on usb bus, it interrupts the mcu, then proceed to perform the specified process that follows. 8.6 power saving mode the em78m612 provides two options of power saving modes for energy conservation, i.e., power down mode, and dual clock mode. 8.6.1 power down mode the em78m612 enters into power down mode by clearing the run register (ioce[4]). during this mode, the oscillator is turned off and the mcu goes to sleep. it will wake up when signal from usb host is resumed, or when the watchdog resets, or the input port state changes. if the mcu wakes up when i/o port status changes , i/o port direction should be set at input, then the port state is read. for example : : // set the port 6 to input port mov a , 0xff iow port6 // read the state of port 6 mov port6, port6 // clear the run bit ior 0xe and a , 0b11101111 iow 0xe : : if the mcu is awaken by a usb resume signal , the next instruction will be executed, and one flag, rc[3] will be set to 1. 8.6.2 dual clock mode the em78m612 has one internal oscillator for power saving application. clearing the bit ioce [7] will enable the low frequency oscillator. at the same time, the external oscillator will be turned off. then the mcu will run under very low frequency to conserve power. four types of frequency are available for sele ction in setting bits ioca [6, 7].
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 29 the usb host resume interrupt can only be used in this mode. if this interrupt is enabled, the mcu will be interrupted when the usb suspend signal is detected on usb bus. 8.7 interrupt the em78m612 has two interrupt vectors, one is in 0x0001, and the other is in 0x000a. when an interrupt occurs while the mcu is runni ng, it will jump to the interrupt vector (0x0001 or 0x000a) and execute the instructions sequentially from interrupt vector. rf is the interrupt status register that records the in terrupt status in the relative flags/bits. the interrupt condition could be one of the following : 1. tcc overflow when the timer clock / counter register (r1) overflows, the status flag rf[0] will be set to 1. its interrupt vector is 0x0001. 2. ep0 interrupt when the udc successfu lly received a setup transaction from host to endpoint0, the status flag rf[1] will be set to 1. its interrupt vector is 0x000a. 3. usb suspend when udc detects a usb suspend signal on usb bus, the status flag rf[2] will be set to 1. its interrupt vector is 0x000a. 4. usb reset when the udc detects a usb reset signal on usb bus, the status flag rf[3] will be set to 1. its interrupt vector is 0x000a. 5. usb host resume when udc detects t hat the usb bus has left the suspend condition, the status flag rf[4] will be set to 1. its interrupt vector is 0x000a. 6. port 5 state change when the input signals in port 5 changes, the status flag rf[5] will be set to 1. its interrupt vector is 0x0001. 7. high pattern detecting interrupt conditions if the pattern detecting application function is enabled, there will be three conditi ons with which interruption is generated, and the status flag rf[6] is set to 1, its interrupt vector is 0x0001. a) p.60 turns to low, and the pattern counter value bigger than ra register value. b) p.60 stays at high, and patte rn counter value equal 0xff. c) p.60 turns to low and pattern counter value bigger than 0xff.
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 30 8. low pattern counter interrupt conditions if the pattern detecting application function is enabled, there will be three conditions with which interruption is generated and the status flag rf[7] is set to 1. its interrupt vector is 0x0001. a) p.60 turns to high, and pattern counter value bigger than rb register value. b) p.60 stays low, and pattern counter value equal 0xff. c) p.60 turns to high, and pattern counter value bigger than 0xff. iocf is an interrupt mask register which c an be set individually bit by bit. while their respective bit is written to 0, the hardware interrupt will inhibit, that is, the em78m612 will not jump to the interrupt vector to execute instruct ions. but the interrupt status flags still records the conditions no matter whether the interrupt is masked or not. the interrupt status flags must be cleared by firmware before leavi ng the interrupt service routine and enabling interrupt. the global interrupt is enabled by the eni (ret i) instruction and is disabled by the disi instruction. 8.8 pattern detecting application (pda) 8.8.1 function description this function is designed for the serial signal transmission, e.g., the transmission between a wireless device and its receiver box. the em78m612 has a built-in pattern detecting application block that ensures the em78m612 s upports wireless devices, such as receiver box controller for a wireless mouse. pattern detecting application (pda) can calcul ate the length of one pattern and interrupt the mcu while the serial signal is transiting from high to low (or vise-versa). then the mcu reads the length value from a specified register. 8.8.2 control register ra (high pattern counter register) default value : (0b_0000_0000) 7 6 5 4 3 2 1 0 hp.7 hp.6 hp.5 hp.4 hp.3 hp.2 hp.1 hp.0 this register is used in pattern detecting applicat ion. if this function is disabled (ioce[2] = 0), the pda function is disabled. ra register is also used as a general-purpose register.
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 31 rb (low pattern counter register) default value : (0b_0000_0000) 7 6 5 4 3 2 1 0 lp.7 lp.6 lp.5 lp.4 lp.3 lp.2 lp.1 lp.0 this register is used in pattern detecting applicat ion. if this function is disabled (ioce[2] = 0), the pda function is disabled. rb register is also used as a general-purpose register. ioc9 (pattern detecting application control register) default value (0b_0111_0000) 7 6 5 4 3 2 1 0 0 sample time.2 sample time.1 sample time.0 0 db.2 db.1 db.0 ioc9 [0~2] deboucing control registers. this is used for pattern detecting application. there are seven degrees available to debounce the input signal noise. ioc9 [4~6] sample time selection registers. th is is used for pattern detecting application. the default value is 111. sample time.2 sample time.1 sample time.0 sample rate ( divide the frequency of external oscillator by ) 0 0 0 1 0 0 1 2 0 1 0 4 0 1 1 8 1 0 0 16 1 0 1 32 1 1 0 64 1 1 1 128 ioc9[3&7] undefined register. the default value is zero. the pda includes an enable control bit, an input pin (p60), a prescaler, a pattern detecting block, two special register (ra and rb), and two interrupts (high pattern counter interrupt and low pattern counter interrupt). to use this function, the enable control bit, ioce[2] has to be set first. otherwise the p60 will just be treated as an input only pin and the ra/rb as general purpose register. as long as the ioce[2] control bit is set to 1 and the p60 is set as input pin, the pattern
em78m612 universal serial bus microcontroller series this spe c ifica t ion may cha nge with out furthe r notice . 2004/4/2 8 v1 .1 32 detecting block will start to sample the p60 input signal and measure the high pulse or low pulse width. after detecting the transition of this signal and debouncing, the value of the counter will be loaded into the ra (if the signal is transiting from high to low) or rb (if the signal is transiting from low to high), and the c ounter is cleared to start counting from zero. two interrupts are supported individually by ra and rb. after the pda function is enabled (by setting ioce[2] to 1), a default value is wr itten to the high pattern counter register and low pattern counter register. then define t he corresponding interrupt enable bits (iocf[6] and iocf[7]). when the counter value of one ?h? pattern is bigger than the ra default value, then the high pattern detecting interrupt will be generated. similarly, if the counter value of one ?l? pattern is bigger than the rb default val ue, the low pattern detecting interrupt will occur. then, the em78m612 will be notified that one successful pattern is received from p60. if these two interrupts are not used, they can be masked. the new counter value of a pattern will still be loaded to the ra and rb. the firmwa re must be made to poll and determines any changes to the value of these two registers. the sample clock is programmable with 8 frequencies to choose from. 8.9 pulse w i d t h modulation (pwm) 8.9.1 function description in pwm mode, both of pwm1 (p64) and pwm2 (p65) produce up to a 8-bit resolution pwm output. pwm output has a duty cy cle and keeps the output high. the pwm period is defined as 0xff * tim e r counter clock . the timer counter clock source is controlled by control register ioc8s. for example; if the clock source is 1mhz, then the period will be 255 seconds. period = 255 * (1/timer counter clock) period (0xff * clock) duty cycle f i g.8.9.2 t he pw m output t i ming the pwm duty cycle is defined by writing to the r8s/r9s register for pwm1/pwm2. duty cycle = r8s * (1/timer counter clock) for pwm1 r9s * (1/timer counter clock) for pwm2
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 33 8.9.2 control register r8s (pwm1 duty cycle register) a specified value keeps the output of pwm1 to remain at high within a period. r9s (pwm2 duty cycle register) a specified value keeps the output of pwm2 to remain at high within a period. ioc8s (pwm control register) default value : (0b_0000_0111) 7 6 5 4 3 2 1 0 pen2 pen1 - - - ps2 ps1 ps0 ioc8s [0~2] pwm clock prescaler. fosc = 6mhz (no matter xtal is 6mhz or 12mhz) ps2 ps1 ps0 clock(hz) period/255 0 0 0 fosc/3 0.5us 0 0 1 fosc/6 1us 0 1 0 fosc/12 2us 0 1 1 fosc/24 4us 1 0 0 fosc/48 8us 1 0 1 fosc/96 16us 1 1 0 fosc/192 32us 1 1 1 fosc/384 64us ioc8s [6,7] pwm1/pwm2 enable bit 0:disable 1:enable 8.10 analog-to-digital converter (adc) 8.10.1 function description the analog to digital converter consists of a 5-bit analog multiplexer, one control register (iocas), one ad channel select register (r as), and two data registers (rbs & rcs) for 10-bit resolution the adc module utilizes successive approximat ion to convert the unknown analog signal to a digital value. the result is fed to the addata. input channels ar e selected by the analog input multiplexer via the adcs/ras bits ad0~ad4.
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 34 10-bit resolution : 0x00-00~0xc0-ff (0b11000000-11111111) start (0x00-00) : 0 vref~(1/1024)*vref full (0xc0-ff) : (1023/1024)*vref~vref conversion rate : 2.5k; 5k; 10k; & 20k 8.10.2 control register ras (ad channel select register) default value : (0b_0000_0000) 7 6 5 4 3 2 1 0 adc token bit 0 ad4 ad3 ad2 ad1 ad0 ras [0~4]:ad channel selector ad4 ad3 ad2 ad1 ad0 channel i/o port 0 0 0 0 0 disable ad - 0 0 0 0 1 1 reserved 0 0 0 1 0 2 p61 0 0 0 1 1 3 p62 0 0 1 0 0 4 p63 0 0 1 0 1 5 p64 0 0 1 1 0 6 p65 0 0 1 1 1 7 p66 0 1 0 0 0 8 p67 0 1 0 0 1 9 p70 0 1 0 1 0 10 p71 0 1 0 1 1 11 p72 0 1 1 0 0 12 p73 0 1 1 0 1 13 p74 0 1 1 1 0 14 p75 0 1 1 1 1 15 p76 1 0 0 0 0 16 p77 ras [6] token bit. this bit is asserted when mcu receives or trans mits usb transaction. ras [7] ad converter ready flag. 0 1 : start ad conversion (set by firmware). 1 0 : when ad finishes converting and has moved digital data into ad data register, this bit will be cleared by hardware. [note] hardware can enable this function only at ad channel selector of the functional i/o port. after power-on reset, the initial value of this register is 0b0000 0000.
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 35 rbs (ad msb data register) default value : (0b_0000_0000) 7 6 5 4 3 2 1 0 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 ad digital data msb 8 bits. rcs (ad lsb data register) default value : (0b_0000_0000) 7 6 5 4 3 2 1 0 bit 1 bit 0 0 0 0 0 0 0 ad digital data lsb 2 bits. iocas (ad control register) default value : (0b_0000_0000) 7 6 5 4 3 2 1 0 0 0 0 0 0 0 adps1 adps0 iocas [0,1]: ad conversion rate. 00: 256khz 01: 128khz 10: 64khz 11: 32khz
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 36 9 absolute maximum ratings symbol min max unit temperature under bias 0 70 oc storage temperature -65 150 oc input voltage -0.5 6.0 v output voltage -0.5 6.0 v 10 dc electrical characteristic (t = 0oc ~70oc, v dd =4.4~5.2v, v ss =0v) symble parameter condition min type max unit 3.3v regulator v rag output voltage of 3.3v regulator v dd = 4.2v ~ 5.2v 3.0 3.3 3.6 v v resetl low power reset detecting low voltage - v v reseth low power reset detecting high voltage - v mcu operation i il input leakage current for input pins vin= v dd ,vss - - 1 a v ihx clock input high voltage osci 2.5 - - v v ilx clock input low voltage osci - - 1.0 v i cc1 v dd operating supply current ? normal frequency operation mode crystal type freq. = 6mhz output pins floating - - 10 ma i cc2 v dd operating supply current ? normal frequency operation mode crystal type freq. = 12mhz output pins floating - - 20 ma i sb1 operating supply current 1 ? power down mode all input and i/o pins at v dd output pins floating wdt disabled - - 50 a i sb2 operating supply current 2 ? low frequency mode rc oscillation type freq. = 20khz~50khz output pins floating - - 200 a gpio pins v ih input high voltage port 5 - - v v il input low voltage port 5 - - v v oh output high voltage (port5 & port 6 & p72~p77), osco) i drive = 5.0ma 2.4 - - v v ol output low voltage (port5 & port 6 & p72~p77, osco) i sink = 5.0ma - - 0.4 v i ph input current with pull-high resister the input pin with internal pull-high resistor of port6 or port7 is connected to v ss . - 25 - a i pl input current with pull-low resister the input pin with internal pull-low resistor of port6 is connected to v dd . - 330 - a
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 37 usb interface v oh static output high 2.8 - 3.6 v v ol static output low - - 0.3 v v di differential input s ensitivity 0.2 - - v v cm differential input command mode range usb operation mode 0.8 - 2.5 v v se single ended receiver threshold 0.8 - 2.0 v c in transceiver capacitance - - 20 pf v rg output voltage of internal regulator 3.0 - 3.6 v i ph input current with pull-high resister (d-) usb operation mode ma programmable large current i sink1 p70, p71 output sink current v out = 0.4v, ioc8[0,1] or ioc8[4,5] = 00 -10% 3 +10% ma i sink2 p70, p71 output sink current v out = 0.4v, ioc8[0,1] or ioc8[4,5] = 01 -10% 6 +10% ma i sink3 p70, p71 output sink current v out = 0.4v, ioc8[0,1] or ioc8[4,5] = 10 -10% 12 +10% ma i sink4 p70, p71 output sink current v out = 0.4v, ioc8[0,1] or ioc8[4,5] = 11 -10% 30 +10% ma internal memory cycle time t rom endurance of program rom t = 25oc, v pp =10v, v nn =-10v 1k - - cycle t ee endurance of e2prom t = 25oc, v dd = 4.4v ~ 5.25v 4k cycle
em78m612 universal serial bus microcontroller series this specification may change without further notice . 2004/4/2 8 v1.1 38 ? 2004 elan microelectronics corporation all rights reserved printed in taiwan, roc, 04/2004 the contents of this specification are subject to change without notice. elan microelectronics assumes no responsibility for errors that may appear in this specification. elan microelectronics makes no commitment to update, or to keep current, the information contained in this specification. the products described herein are not intended for use in life support appliances, devic es, or systems. use of elan microelectronics products in such applications are not supported and is prohibited. no part of this specification may be repro duced or transmitted in any form or by any means without the express written permission of elan microelectronics. elan microelectronics corporation headquarters: no. 12, innovation road 1, science-based industrial park, hsinchu, taiwan, r.o.c. tel : +886 3 5639977 fax : +886 3 5639966 http://www.emc.com.tw hong kong office: rm. 1005b, 10/f empire centre 68 mody road, tsimshatsui kowloon , hong kong tel : +852 2838-8715 fax : +852 2838-0497


▲Up To Search▲   

 
Price & Availability of EM78M612CBM

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X